fix(builders): improve component validation predicates#11291
fix(builders): improve component validation predicates#11291hakkiai wants to merge 2 commits intodiscordjs:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
94cc6b4 to
075dc04
Compare
Qjuh
left a comment
There was a problem hiding this comment.
This seems like a mix of v3>v4 and v4>v3 changes somehow, what made you do these changes?
| export const selectMenuChannelPredicate = selectMenuBasePredicate.extend({ | ||
| type: z.literal(ComponentType.ChannelSelect), | ||
| channel_types: z.enum(ChannelType).array().optional(), | ||
| channel_types: z.nativeEnum(ChannelType).array().optional(), |
There was a problem hiding this comment.
nativeEnum() is deprecated in zod v4, enum() was correct here, as it is overloaded to also do this in v4.
|
Thank you for the clarification @Qjuh
|
|
As far as I can see the main aspect of this PR has been done and merged by #11290 already. The change from |
Fixed the incorrect Zod usage in the component predicates. Replaced the invalid
z.literal([...])patterns with proper unions, switched toz.nativeEnumforruntime enums, and moved the old
.check()logic tosuperRefine().This cleans up the schemas and fixes the issue with select menu default values.